class PackUploader < CarrierWave::Uploader::Base
  storage :file

  def store_dir
    "packages/#{model.platform}"
  end

  def filename
    "#{model.platform}-#{model.ver}.#{file.extension}" if original_filename
  end

  protected
  def secure_token
    var = :"@#{mounted_as}_secure_token"
    model.instance_variable_get(var) or model.instance_variable_set(var, SecureRandom.uuid)
  end

end
